1. Field of the Invention
Apparatuses and methods consistent with the present invention relate to using a non-volatile memory as a cache and a method of operating the same, and more particularly, to a storage apparatus using a non-volatile memory as a cache and a method of operating the same, in which the non-volatile memory is used as the cache so as to preserve data even when electricity is interrupted.
2. Description of the Related Art
A general storage apparatus 10 includes a host 11, a data buffer (cache) 12, and a main storage medium 13, as shown in FIG. 1. The host 11 transmits data to and receives data from the main storage medium 13 according to a user's instructions. Generally, a memory smaller and faster than the main storage medium 13 is used as the data buffer 12 in order to buffer the difference of velocities between the host 11 and the main storage medium 13 and increase the access efficiency of the storage apparatus. The data is not directly recorded on the storage medium 13 which has a slow processing velocity, rather the data is recorded on the data buffer 12 which has a fast processing velocity. Accordingly, the recording speed can be improved. Further, some data in the main storage medium 13 is in advance moved into the data buffer 12, so as to improve reading speed.
That is, the data transmitted from the host 11 are stored in the data buffer 12 until the data are recorded on the main storage medium 13, while the data transmitted from the main storage medium 13 are stored in the data buffer 12 before the data are transmitted to the host 11. In the storage apparatus 10, a volatile memory is generally used as the data buffer 12. Therefore, when the electricity supplied to the storage apparatus is interrupted, all the data present in the data buffer 12 disappear. If the data buffer is increased in order to improve the access efficiency, the quantity of data lost due to the power interruption also increases. Further, since electricity is always supplied to the main storage medium 13 in order to decrease the loss of data, there is difficulty in reducing the consumption of electricity.
In order to solve the above-mentioned problem, a non-volatile memory has been recently used as a cache in a storage apparatus 10. Accordingly, while the host 11 reads data from and writes data onto the non-volatile memory, the supply of electricity to the main storage medium 13 is interrupted so that the consumption of electricity can be reduced.
However, when using the non-volatile memory as the cache of the storage apparatus 10, it has been required to effectively manage the data in a stationary region of the non-volatile memory in which predetermined data are always located and a non-stationary region in which data are frequently recorded and erased, and to safely protect data when the electricity is suddenly interrupted. Further, it has been required to retrieve blocks in order to reduce time for supplying electricity to the main storage medium 13, and to increase lifetime of the non-volatile memory in consideration of the wear level of each physical block in the non-volatile memory.
Japanese Laid-open Patent Publication 2003-256289 discloses a flash memory system capable of assigning addresses. The flash memory system has blocks partitioned therein, and periodically allocates and deletes the blocks according to a circular sequence (allocating and deleting of the blocks is carried out at the lowest and highest addresses among physical sector addresses), thereby maintaining coherence of wear level thereof. However, the above-mentioned publication does not disclose methods of effectively managing the data in the stationary and non-stationary regions, protecting the data when electricity is suddenly interrupted, retrieving the blocks and extending the lifetime of the flash memory system by adjusting the wear level of the memory system.